<?php
include ('MySQL.php');

class Controle {

	private $usuario;

	function set($prop, $value) {
		$this->$prop = $value;
	}

	function fetch($query){
		$row = mysql_fetch_array($query);
		return $row;
	}

	function validar($login, $senha){
			
		$connect = MySQL::getInstance();

		$query = $connect->select_user_login($login);

		if(mysql_num_rows($query)>0){
			$row = mysql_fetch_array($query);
			if($senha!=$row['Senha']){
				return false;
			}
			else{
				$usuario = $row ['Matricula'];
				return $usuario;
			}
		}
		else
		return false;
	}

	private function filtrar($string){
		$filtrado = trim(addslashes($string));
		return $filtrado;
	}
}
?>